<template>
	<view :class="['message-item', detail.type==1?'':'message-item-my']">
		<view class="message-robot-wrap" v-if="detail.type==1">
			<view class="robot-icon">
				<image  src="@/static/img/icon_touxiang.png" mode=""></image>
			</view>
			<view class="text-message-wrap">
				{{ detail.content }}
			</view>
		</view>
		<view class="message-wrap" v-else>
			{{ detail.content }}
		</view>
	</view>
</template>

<script setup lang="ts">
	const props = defineProps({
		detail: {
			type: Object,
			default: {}
		}
	})
</script>

<style lang="scss" scoped>
	.message-item{
		display: flex;
		padding: 0 60rpx 32rpx 34rpx;
		.message-robot-wrap{
			display: flex;
			.robot-icon{
				height: 80rpx;
				width: 80rpx;
				border-radius: 50%;
				// background-color: #000;
				// padding: 16rpx;
				margin-right: 16rpx;
				image{
					height: 100%;
					width: 100%;
				}
			}
			.text-message-wrap{
				flex: 1;
				background-color: #ffffff;
				font-size: 32rpx;
				padding: 32rpx;
				word-break: break-all;
				text-align: justify;
				border-radius: 0 48rpx 48rpx 48rpx;
			}
		}
	}
	.message-item-my{
		justify-content: flex-end;
		padding-left: 114rpx;
		.message-wrap{
			background-color: #ffffff;
			font-size: 32rpx;
			padding: 20rpx 32rpx;
			border-radius: 48rpx;
			word-break: break-all;
			text-align: justify;
		}
	}
</style>